<?php
include("libs/smarty.class.php");
include("functions.php");

$smarty = new Smarty();
$title = "Oferty praktyki";
$smarty->assign("title",$title);

$sql = mysql_query("SELECT p.id,p.add_date,p.date_start,p.date_end,p.amount,p.status,
    (SELECT co.name FROM user_company co WHERE (p.company_id = co.id)) AS company_name
    FROM practices p WHERE p.status = 0 LIMIT 0, 30 ");

$practices = array();

while($row = mysql_fetch_assoc($sql)){
    $practices[] = $row;

}

$smarty->assign("practices",$practices);
$smarty->display('show_practices.tpl');
?>
